package cn.web03.websocket.config;

import cn.web03.websocket.send.MyWebsocketServer;
import cn.web03.websocket.service.SocketMessageService;
import cn.web03.websocket.service.SocketUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @author 零三 2020.06
 * https://web03.cn
 */
@Configuration
public class WebsocketConfiguration {

    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
    @Autowired
    public void socketUserService(SocketUserService socketUserService){
        MyWebsocketServer.socketUserService = socketUserService;
    }
    @Autowired
    public void socketMessageService(SocketMessageService socketMessageService){
        MyWebsocketServer.socketMessageService = socketMessageService;
    }
}
